<?php

namespace addons\qingdong\validate;

use think\Validate;

class Event extends Validate {
	/**
	 * 验证规则
	 */
	protected $rule = [
		'staff_id'      => 'require|number',
		'title'         => 'max:50',
		'start_time'    => 'require|date',
		'end_time'      => 'require|date',
		'type'        => 'number|between:1,5',
		'status'        => 'number|between:0,5',
		'level'         => 'number|between:1,5',
		'remindtype'    => 'number|between:0,10',
		'remark'        => 'max:250',
		'color'         => 'max:15',
		'relation_type' => 'number|between:1,5',
		'relation_id'   => 'number',
	];
	/**
	 * 提示消息
	 */
	protected $message = [];
	/**
	 * 字段描述
	 */
	protected $field = [
		'staff_id'      => '员工',
		'title'         => '日程标题',
		'start_time'    => '开始时间',
		'end_time'      => '开始时间',
		'status'        => '日程状态',
		'level'         => '紧要程度',
		'remindtype'    => '提醒时间',
		'remark'        => '备注',
		'color'         => '颜色',
		'relation_type' => '关联类型',
		'relation_id'   => '关联类型ID',
	];
	/**
	 * 验证场景
	 */
	protected $scene = [
		'create'      => ['title', 'start_time', 'end_time', 'status', 'level', 'remindtype', 'remark', 'color', 'relation_type', 'relation_id'],
		'create_task' => ['title', 'start_time',  'status', 'remindtype'],
		'edit'        => [],
	];
}
